#pragma once

#include "MFCOpenGLView.h"
#include "3DModels.h"

// CUberViewerView view

class CUberViewerView : public COpenGLView
{
	DECLARE_DYNCREATE(CUberViewerView)

protected:
	CUberViewerView();           // protected constructor used by dynamic creation
	virtual ~CUberViewerView();

private:
    VECTOR3f   m_PickRayDir,
			   m_PickRayOrig;

//    CModelManager   *m_pModelManager;
//    CTextureManager *m_pTextureManager;

// Attributes
public:
	CUberViewerDoc* GetDocument();

//	BOOL	IntersectTriangle(const D3DXVECTOR3& orig, const D3DXVECTOR3& dir, D3DXVECTOR3& v0, D3DXVECTOR3& v1, D3DXVECTOR3& v2, FLOAT* t, FLOAT* u, FLOAT* v);
//	BOOL	CheckPickTriangleStrip(int vertexIndex, int vertexCount, float *fDist);
//	BOOL	CheckPickTriangleList(SIfcDocument *doc, int vertexIndex, int vertexCount, float *fDist);
//  bool	CheckPBoundingBox(SIfc3DObject * instance);
//	bool	CheckPickBoundingBox(SIfc3DObject * instance, float *fDist);
//	bool	CheckPick(CPoint &point);


private:
	void InitializeTextures();

	virtual void RenderScene();      // overridden to draw the 3D scene in opengl
	void RenderOpaque(CModel *model);
	void RenderTransp(CModel *model);
//	void RenderGml(CGmlModel *gml);

    afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
    afx_msg void OnSetOSmap(); 
    afx_msg void OnUpdateOSmap(CCmdUI* pCmdUI); 

#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnViewOpenstreetmap();
};


